<!--
 * @Description  : 
 * @Author       : zhao
 * @Date         : 2022-06-28 11:16:18
 * @LastEditors  : zhao
 * @LastEditTime : 2023-02-24 08:40:53
-->

<!-- 内容页 返回 -->
<template>
    <div class="title">
        <div class="title-top" @click="back">
            <i :class="icon" style="cursor: pointer" />
            <span class="cursor">{{ name }}</span>
        </div>
    </div>
</template>

<script>
export default {
    name: "",
    components: {},
    props: {
        name: String,
        icon: {
            type: String,
            default: "fa fa-arrow-left",
        },
        url: null,
    },
    data() {
        return {}
    },

    computed: {},

    mounted() {},

    methods: {
        back() {
            if(this.$route.path == "/FileInfoDetails"){
                if (this.$route.params.type && this.$route.params.type == "SpatialRetrieval") {
                // 如果起始页为“空间检索”查找后的页面
                
                    // window.location.href="about:blank";
                    // window.close();
                    // window.history.go(-1)
                    // console.log(this.$store.state.map.selectType)
                    // this.$store.state.map.pageType = "SpatialRetrieval"
                    // this.$router.back()
                    // window.close();
                    // // 返回储存值空间检索，否则属性查找
                    // this.$router.push({ name: "SpatialRetrieval", params: this.$route.params.searchData })
                    window.opener = null;
                    window.open("", "_self");
                    window.close();
                
            // 全部返回“属性查询”
            //     this.$router.push({ name: "AttributeQuery", params: this.$store.state.table.searchData })
            // } else {
            //     this.$router.go(-1)
            };
            };
            

            if (this.$route.path == "/FileInfoDetails"){
                this.$router.push({ name: "AttributeQuery", params: this.$store.state.table.searchData })
            };

            if (this.$route.path == "/BorrowFormDetail") {
                this.$router.push({ name: "BorrowForm", params: this.$store.state.table.searchData })
            };

            // if (this.$route.path == "/SpatialRetrieval") {
            //     this.$router.push({ name: "AttributeQuery", params: this.$store.state.table.searchData })
            // };
        },
    },
}
</script>
<style lang='scss' scoped>
.title {
    padding-bottom: 10px;
}

.title-top {
    height: 30px;
    line-height: 30px;

    i {
        font-size: 24px;
        color: #3388ff;
    }

    span {
        padding: 0 10px;
        font-size: 24px;
        color: rgb(104, 182, 242);
    }
}
</style>
